<?php
class PapiWS_Model_TextBoxVO extends PapiWS_Model_GraphicalObjectVO
{
	const TEXT_BOX = 'textbox';
	
	public $id;
	public $fontUrl;
	public $swfUrl;
	public $fontVO;
	public $text;
	public $family;
	public $letterSpacing;
	public $lineHeight;
	public $bold = false;
	public $italic = false;
	
	public function __construct( $data = null)
	{
		
		$this->type = self::TEXT_BOX;

		if ( $data == null )
			return;

		$this->text = $data['body'];
		
		if( isset( $data['field_family'][0]['value'])) {
			$this->family = $data['field_family'][0]['value'];
		}
		
		if( isset( $data['field_italic'][0]['value'])) {
			$this->italic = $data['field_italic'][0]['value'];
		}
		
		if( isset( $data['field_bold'][0]['value'])) {
			$this->bold = $data['field_bold'][0]['value'];
		}		
	}
}
